package com.itheima.springmvc.dao;

import com.itheima.springmvc.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：seanyang
 * @date ：Created in 2022/4/15
 * @description ：
 * @version: 1.0
 */
public interface UserDao {

	@Insert("INSERT INTO user (id, name, sex, address) " +
		"VALUES (null,#{name}, #{sex},#{address})")
	int insert(User user);

	@Select("select * from user")
	List<User> queryAll();

	@Select("select * from user where id = ${id} ")
	User selectUserById(Integer id);
}